package com.taylor.spring5.service;

import com.taylor.spring5.dao.BookDao;
import com.taylor.spring5.entity.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author taylor
 * @Description: TODO
 * @date 2021/4/5 22:26
 */
@Service
public class BookService {
    //注入 dao
    @Autowired
    private BookDao bookDao;

    public int add(){
        Book book = new Book();
        book.setBookId("1");
        book.setBookName("spring5");
        book.setAuthor("taylor");
        int i = bookDao.add(book);
        return i;
    }
}
